#include <bits/stdc++.h>
using namespace std;
const int N=1e5+5;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
    return x*f;
}
int wtp,wstk[40];
void write(int x,char c){
    if(x<0) x=-x,putchar('-');
    do{wstk[++wtp]=x%10,x/=10;}while(x);
    while(wtp){putchar(wstk[wtp--]^48);}
    if(c) putchar(c);
}
int n,p,ans,a[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=ans=read();
    for(int i=1;i<=n;i++) a[i]=read();
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        while(p<=i) p++;
        while(p<=n&&a[p]<=a[i]) p++;
        if(a[p]>a[i]) p++,ans--;
    }
    write(ans,'\n');
    return 0;
}
